<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="../WEB-INF/template_admin.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditPedidoTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">

            <div class="content">

                <br />
                <ul class="lista-mapa-sitio">
                    <li><a href="#{request.contextPath}/faces/administrador.xhtml">Administrar</a> / </li>
                    <li><a href="#{request.contextPath}/faces/pedido/ListaPedido.xhtml">Pedidos</a> / </li>
                    <li>Editar Pedido</li>
                </ul>
                <p:growl id="growl" />
                <p:panel header="Editar Pedido" styleClass="panel-usuario" style="width: 600px">

                    <h:panelGroup id="messagePanel" layout="block">
                        <p:messages autoUpdate="true"/>
                    </h:panelGroup>
                    <h:form>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="#{bundle.EditPedidoLabel_pedFecha}" for="pedFecha" />
                            <p:calendar id="pedFecha" pattern="dd/MM/yyyy HH:mm:ss a" value="#{pedidoController.selected.pedFecha}" title="#{bundle.CreatePedidoTitle_pedFecha}" required="true" requiredMessage="#{bundle.CreatePedidoRequiredMessage_pedFecha}" locale="es" effect="fadeIn" navigator="true" />
                            <h:outputLabel value="#{bundle.EditPedidoLabel_pedEstadoId}" for="pedEstadoId" />
                            <p:selectOneMenu id="pedEstadoId" value="#{pedidoController.selected.pedEstadoId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_pedEstadoId}">
                                <f:selectItems value="#{pedidoEstadoController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.EditPedidoLabel_pedMedPagoId}" for="pedMedPagoId" />
                            <p:selectOneMenu id="pedMedPagoId" value="#{pedidoController.selected.pedMedPagoId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_pedMedPagoId}">
                                <f:selectItems value="#{medioPagoController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.EditPedidoLabel_pedEmpId}" for="pedEmpId" />
                            <p:selectOneMenu id="pedEmpId" value="#{pedidoController.selected.pedEmpId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_pedEmpId}">
                                <f:selectItems value="#{empleadoController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                            <h:outputLabel value="#{bundle.EditPedidoLabel_pedUsuarioId}" for="pedUsuarioId" />
                            <p:selectOneMenu disabled="true" id="pedUsuarioId" value="#{pedidoController.selected.pedUsuarioId}" required="true" requiredMessage="#{bundle.EditPedidoRequiredMessage_pedUsuarioId}">
                                <f:selectItems value="#{usuarioPersonaRolController.itemsAvailableSelectOne}"/>
                            </p:selectOneMenu>
                        </h:panelGrid>
                        <br />
                        <p:commandLink actionListener="#{pedidoController.update}" value="#{bundle.EditPedidoSaveLink}" update=":growl"/>
                        <br />
                        <br />
                        <h:commandLink class="jsfcrud_commandlinks_action" action="#{pedidoController.prepareList}" value="#{bundle.EditPedidoShowAllLink}" immediate="true"/>
                        <br />
                        <br />
                    </h:form>
                </p:panel>
            </div><!-- end of content -->
        </ui:define>
    </ui:composition>

</html>
